<@pp.dropOutputFile/>
<#-- iterate table list-->
<#list doc.tables as table>

<#-- generate package name -->
<#assign package = doc.groupid?replace(".", "/")> 
<#assign package = package + "/" + doc.artifactid?replace(".", "/")>
<#assign package = package + "/" + table.moduleid?replace(".", "/")>
<#assign fileName = table.name?cap_first>
<@pp.changeOutputFile name="/main/" + package + "/service/" + fileName + "Service.java"/>
/*
 * File name : ${fileName}Service.java ${doc.date}
 * Copyright ${doc.copyright}. All rights reserved.
 */
package ${package?replace("/", ".")}.service;

import java.util.List;

import org.xust.common.Result;
import org.xust.common.pagination.domain.Page;
import ${package?replace("/", ".")}.domain.${fileName};

/**
 * Interface ${fileName}Service
 * ${fileName} service interface.
 * @author ${doc.author}
 * @version ${doc.version}, ${doc.date}
 */
public interface ${fileName}Service {

	/**
	 * Insert new ${fileName} object.
	 * @param newValue New object.
	 * @return The id of new object.
	 */
	public Result<Integer> insert(${fileName} newValue);

	/**
	 * Delete all objects.
	 * @return The number of rows affected.
	 */
	public Result<Integer> deleteAll();

	/**
	 * Delete object by id.
	 * @param id Target id.
	 * @return The number of rows affected.
	 */
	public Result<Integer> deleteById(int id);

	/**
	 * Delete objects which id were included in items array.
	 * @param items Target ids.
	 * @return The number of rows affected.
	 */
	public Result<Integer> deleteItems(Integer[] items);

	/**
	 * Retrieve object by id.
	 * @param id Target id.
	 * @return Target object.
	 */
	public ${fileName} findById(int id);

	/**
	 * Retrieve all objects.
	 * @return Target objects.
	 */
	List<${fileName}> findAll();
	
	/**
	 * Retrieve objects in specified page.
	 * @param page Page information.
	 * @return Target objects.
	 */
	public List<${fileName}> findPage(Page page);
	
	/**
	 * Retrieve the number of objects.
	 * @return The number of objects.
	 */
	public Result<Integer> size();
	
	/**
	 * Update specified object.
	 * @param newValue Target object.
	 * @return The number of rows affected.
	 */
	public Result<Integer> update(${fileName} newValue);
}
</#list>